From: Eli Zaretskii Date: Wed, 30 Jul 2025 16:48:07 +0000 (+0300) Subject: ; Improve documentation of change hooks X-Git-Tag: archive/raspbian/1%30.2+1-2+rpi1^2~2^2~24^2~13 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22Program/%22http:/www.example.com/cgi/%22https:/%22Program?a=commitdiff_plain;h=456f44a7b3cee7ac6dd3b13dc6690d14f5dd3603;p=emacs.git ; Improve documentation of change hooks * doc/lispref/text.texi (Change Hooks): Warn against buffer changes in the hook functions. (Bug#79115) --- diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 8329a67d6c2..dc35e93f2da 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -6291,7 +6291,11 @@ specific parts of the text. The functions you use in these hooks should save and restore the match data if they do anything that uses regular expressions; otherwise, they will interfere in bizarre ways with the editing operations that call -them. +them. In addition, the functions in these hooks should avoid changing +buffer text, faces, properties, overlays, and other aspects of the +buffer-specific state except those that the hook functions themselves +create and manage, because other parts of Emacs might become confused by +such changes behind their back. @defvar before-change-functions This variable holds a list of functions to call when Emacs is about to